a = [1, 2, 3, 4, 5, 6, 7, 8]
print(a[2:])  # 下标从0开始
print(a[2:5])
print(a[2:7:2])
print(a[2:-2])
print(a[2:-1])
print(a[::-1])  # 反转列表
print(a[-1::-1])  # 反转列表


x = "how window size y"
print(x.index("y"))  # 找不到就报错
print(x.find("z"))  # 找不到就返回-1
print(x.upper())
print(x.lower())
print(x.join("-x"))
print(x.split(" "))
print(x.encode())
print(x.endswith("f"))  # 判断结尾是不是以f
